package io.youngledo.usb.storage;

import io.youngledo.usb.storage.impl.*;

/// 对象存储服务工厂
/// 根据存储类型创建相应的服务实例
///
public class StorageServiceFactory {

    /// 创建存储服务实例
    ///
    /// **参数:** `type` - 存储类型
    /// **返回值:** 存储服务实例
    /// **异常:** `io.youngledo.usb.exception.UniversalStorageException` - 如果不支持指定的存储类型
    ///
    public static ObjectStorageService createService(StorageType type) {
        return switch (type) {
            case MINIO -> new MinioStorageService();
            case ALIYUN_OSS -> new AliyunStorageService();
            case TENCENT_COS -> new TencentStorageService();
            case HUAWEI_OBS -> new HuaweiStorageService();
            case QINIU_KODO -> new QiniuStorageService();
            case BAIDU_BOS -> new BaiduStorageService();
            case VOLC_ENGINE_TOS -> new VolcEngineStorageService();
        };
    }

}